home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE23 / STARTUP / StubDllU.pas < prev    next >
Pascal/Delphi Source File  |  1996-03-21  |  568b  |  30 lines

  1. unit StubDllU;
  2.  
  3. interface
  4.  
  5. implementation
  6.  
  7. uses
  8.   SysUtils, WinProcs;
  9.  
  10. var
  11.   OldExitProc: Pointer;
  12.  
  13. procedure NewExitProc; far;
  14. begin
  15.   ExitProc := OldExitProc;
  16.   OutputDebugString('DLL: Exit procedure added the old fashioned way (ExitProc)'#13#10);
  17. end;
  18.  
  19. procedure NewerExitProc; far;
  20. begin
  21.   OutputDebugString('DLL: Exit procedure added with AddExitProc'#13#10);
  22. end;
  23.  
  24. initialization
  25.   OutputDebugString('DLL: Unit initialisation section'#13#10);
  26.   OldExitProc := ExitProc;
  27.   ExitProc := @NewExitProc;
  28.   AddExitProc(NewerExitProc);
  29. end.
  30.